#ifndef PRINCIPALE_H
#define PRINCIPALE_H

//#include <qpopupmenu.h>
#include <Q3PopupMenu>
#include <qmenubar.h>
#include <qmainwindow.h>
#include <qstatusbar.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include <qpixmap.h>
#include <qsplitter.h>
#include <qfiledialog.h>
#include <qlistview.h>
#include <qslider.h>
#include <qapplication.h>
#include <qspinbox.h>
#include <q3listview.h>

class Graphique;
class SceneXmlParser;
class sngParser;
class ParamWidget;
class Collection;
class configcontrol;

class Principale : public QWidget{
Q_OBJECT
public:

	~Principale();
	static Principale* getInstance();
	QMainWindow* getFenetrePrincipale( void ) { return fenetrePrincipale; }
	void updateParamTab();
	void loadSong(QString sngpath, QString mp3path = QString::null);
	void saveSongAs(QString path);
	void saveSong();
	void setupControls(int*,int*);
	Collection* getCollection() {return m_collection;}
	QString getCurrentSngPath();

	Graphique *graphique;
	Graphique *graphique2;
	Q3ListView *dataTreeView;
	QStatusBar* barreStatut;
	QMainWindow* fenetrePrincipale;
	ParamWidget *paramTab;

	QSlider *songslider;
	QSpinBox *spacing;
//	QToolBar* barreOutils ;
//	QToolButton *buttonPoint;
//	QToolButton *buttonFace;


public slots:

	void slotPlay();
	void slotUpFreq();
	void slotDownFreq();
	void slotForward();
	void slotBackward();
	void slotJoystickInfo();
	void slotWebcamInfo();
	void slotOpenScene();
	void slotSongSliderMoved(int);
	void slotSpacingChanged(int);
	void slotSaveSngAs();
	void slotSaveSng();
	void slotAddToCollection();
	void slotBrowseCollection();
	void slot2players();
	void slotconfigcontroller();

private:
  static Principale* instance;
  QMenuBar* m_barreMenu;
  QSplitter *m_splitter;
  Collection *m_collection;
  configcontrol* m_controlwin;

//	QPopupMenu* menuInfo;
  Principale(void);
  SceneXmlParser *m_data;
  sngParser *m_songparser;
  QToolBar *m_barreOutils;
  Q3PopupMenu* menuFile;
  Q3PopupMenu* menuGame;
};

#endif
